Skip to content

Fix/agentflow Add support for XML tag in markdown input and render markdown conditionally#6145

Merged
j-sanaa merged 11 commits intomainfrom
fix/agentflow-xml-limit-markdown
Apr 6, 2026
Merged

Fix/agentflow Add support for XML tag in markdown input and render markdown conditionally#6145
j-sanaa merged 11 commits intomainfrom
fix/agentflow-xml-limit-markdown

Conversation

@j-sanaa
Copy link
Copy Markdown
Contributor

@j-sanaa j-sanaa commented Apr 3, 2026

Ported #6061 and #6095 from legacy UI to agentflow

  • added support for XML tag preservation — XML tags like are now preserved through TipTap's markdown round-trip instead of being stripped.
  • Added functionality to conditionally configure link support based on the useMarkdown prop
Custom.XML.tags.mov
Limit.HTML.tags.mov

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements a system to preserve XML and HTML tags during TipTap's markdown serialization and deserialization processes. It introduces new utilities for escaping and unescaping tags, refactors existing editor helpers into a centralized xmlTagUtils.ts file, and updates the RichTextEditor and VariableInput components to utilize these utilities. Review feedback highlights opportunities to deduplicate content loading logic within the editor components and suggests seeking a more type-safe approach for the cache manager configuration in the server package.

Comment thread packages/agentflow/src/atoms/RichTextEditor.tsx
Comment thread packages/agentflow/src/atoms/VariableInput.tsx
Comment thread packages/server/src/UsageCacheManager.ts Outdated
@j-sanaa j-sanaa marked this pull request as ready for review April 4, 2026 00:16
* dependencies, and the false-positive/negative risk for agentflow node inputs
* is negligible (users don't normally write raw HTML into prompt fields).
*/
export function isHtmlContent(content: unknown): boolean {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: why do we delete this file and replace with a new one (xmlTagUtils) completely instead of porting the changes and show diff from xmlTagUtils to here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved all the changes from editorUtils to xmlTagUtils to have the same naming convention as v2

Comment thread packages/agentflow/src/atoms/RichTextEditor.tsx Outdated
@j-sanaa j-sanaa merged commit e2ecc0b into main Apr 6, 2026
7 checks passed
@j-sanaa j-sanaa deleted the fix/agentflow-xml-limit-markdown branch April 6, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants